Calculating the number of points strictly inside a ring with given inner and outer radii, centered at (0,0).
Constructing the largest possible palindromic number from a string of decimal digits, ensuring no leading zeros.
For the first problem, given the coordinates of N points, the function solution(inner, outer, points_x, points_y) determines how many lie strictly inside the ring's area.
For the second problem, from a string S containing decimal digits, the goal is to reorder the digits to form a palindromic number with the maximum decimal value, without any leading zeros.
In summary, the first function counts points inside a ring, while the second function constructs the largest palindromic number from a string of digits.
מימוש מערכת שמדמה את הקאש של הזיכרון. כך שהגישה לפריטים שהיו בשימוש לאחרונה תהיה מהירה, הקיבולת של הקאש מוגבל. צריך לממש מבנה נתונים בעל שתי פונקציות של get וinput
להשתמש בפונקציה שמעבירה בלוקים של זיכרון עד גודל של אלף בייט, נדרש לממש פונק' בכדי להעביר בלוקים גדולים יותר.
המגבלות הם שנדרש בתחילת (Byte 0) כל בלוק לסמן האם הוא תחילי אמצע או בלוק אחרון.
כאשר לא ניתן\נדרש להשתמש בהקצאת זיכרון נוספת.
תשובות
הוסף תשובה
|
לצפיה בתשובות
אפריל 2024
הפתרון הוא בעצם להחליף את index-1 בתחילית הרצוי ובבלוק הראשון הקצאה ראשונית של buffer[2] של תחילית + רפרנס לתחילת הבלוק.